// 工具相关类型定义
export interface ToolFunction {
  name: string;
  description: string;
  parameters: {
    properties: Record<string, any>;
    required?: string[];
  };
}

export interface ToolDefinition {
  type: 'function';
  function: ToolFunction;
}

export abstract class BaseTool {
  abstract name: string;
  abstract description: string;
  abstract parameters: ToolFunction['parameters'];

  abstract execute(args: Record<string, any>): Promise<string>;

  getDefinition(): ToolDefinition {
    return {
      type: 'function',
      function: {
        name: this.name,
        description: this.description,
        parameters: this.parameters
      }
    };
  }
}

export interface ToolRegistry {
  [key: string]: BaseTool;
}
